package com.lantosec.hmrp.modules.eval.entity;

import java.time.LocalDateTime;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.*;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.eval.vo.EvalSchemeVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 考评方案 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-03-16
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EvalScheme extends BaseEntity<EvalSchemeVO> {

    private static final long serialVersionUID = 1L;
    public EvalScheme(EvalSchemeVO vo){
        this.evalSchemeId = vo.getEvalSchemeId();
        this.evalSchemeName = vo.getEvalSchemeName();
        this.ownerUserId = vo.getOwnerUserId();
        this.createUserId = vo.getCreateUserId();
        this.createUser = vo.getCreateUser();
        this.createTime = vo.getCreateTime();
        this.editorUserId = vo.getEditorUserId();
        this.editorUser = vo.getEditorUser();
        this.editorTime = vo.getEditorTime();
    }

    @Override
    public EvalSchemeVO convertToVO(){
        return new EvalSchemeVO(this);
    }


    /**
     * 考评方案ID
     */
    @TableId(value = "eval_scheme_id", type = IdType.AUTO)
    private Integer evalSchemeId;

    /**
     * 考评方案名称
     */
    private String evalSchemeName;

    /**
     * 拥有者ID,当为null时为公共方案,否则为私有
     */
    @TableField(fill = FieldFill.UPDATE)
    private String ownerUserId;

    /**
     * 创建人ID
     */
    private String createUserId;

    /**
     * 创建人
     */
    private String createUser;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 最后编辑人ID
     */
    private String editorUserId;

    /**
     * 最后编辑人
     */
    private String editorUser;

    /**
     * 最后编辑时间
     */
    private Date editorTime;


    public enum ColName {
        eval_scheme_id, eval_scheme_name, owner_user_id, create_user_id, create_user, create_time, editor_user_id, editor_user, editor_time, 
    }
}
